<template>
	<view class="custom-confirm ss-p-x-16 ss-p-y-20">
		<view class="custom-confirm-title">请您确认收货地址</view>
		<view class="custom-confirm-goods ss-flex ss-m-t-10">
			<image class="custom-confirm-goods-image ss-m-r-25" :src="cdn(message.payload.custom.imgUrl)"
				mode="aspectFill">
			</image>
			<view class="custom-confirm-goods-text">
				<view class="ss-flex">
					<view class="custom-confirm-goods-text-name ss-flex-1 ss-line-1 ss-m-r-20">
						{{message.payload.custom.title}}
					</view>
					<view class="custom-confirm-goods-text-name">
						￥{{message.payload.custom.order_money}}</view>
				</view>
				<view class="custom-confirm-goods-text-num ss-m-t-10">
					共{{message.payload.custom.num}}件</view>
			</view>
		</view>
		<view class="custom-confirm-goods-person">
			收货人：<text>{{message.payload.custom.name}}</text></view>
		<view class="custom-confirm-goods-person">
			手机号码：<text>{{message.payload.custom.phone}}</text></view>
		<view class="custom-confirm-goods-person ss-line-2">
			详细地址：<text>{{message.payload.custom.address}}</text></view>
		<view class="ss-flex align-center justify-end ss-m-t-20">
			<view class="custom-confirm-goods-edit ss-m-r-15" @click="jumpCustom(message,true)">修改地址</view>
			<view class="custom-confirm-goods-confirm" @click="jumpCustom(message)">确认
			</view>
		</view>
	</view>
</template>

<script setup>
	import sheep from '@/sheep';
		import {cdn,udid} from '@/im/config/index.js'
	
	const props = defineProps({
		message: {
			type: Object,
			default: {}
		}
	})

	const jumpCustom = (msg, jump = false) => {
		if (udid === msg.payload.custom.tag) {
			if (jump) {
				uni.navigateTo({
					url:msg.payload.custom.editUrl
				})
			} else {
				uni.navigateTo({
					url:msg.payload.custom.sureUrl
				})
			}
		} else {
			uni.showToast({
				title: '请前往指定平台查看详情!',
				icon: 'none',
				duration: 2000
			});
		}
	}
</script>

<style scoped lang="scss">
	view {
		box-sizing: border-box;
	}

	.custom-confirm {
		width: 452rpx;
		background: #FFFFFF;
		border-radius: 0 12rpx 12rpx 12rpx;

		.custom-confirm-title {
			font-weight: 500;
			font-size: 28rpx;
			color: #333333;
		}

		.custom-confirm-goods {
			.custom-confirm-goods-image {
				width: 160rpx;
				height: 160rpx;
				border-radius: 10rpx;
			}

			.custom-confirm-goods-text {
				flex: 1;
				height: 160rpx;

				.custom-confirm-goods-text-name {
					font-weight: 500;
					font-size: 28rpx;
					color: #322D28;
				}

				.custom-confirm-goods-text-num {
					width: 100%;
					text-align: right;
					font-weight: 350;
					font-size: 24rpx;
					color: #999999;
				}
			}
		}

		.custom-confirm-goods-person {
			font-weight: 400;
			font-size: 24rpx;
			color: #A3A3A3;
			margin-top: 15rpx;

			text {
				color: #333333;
			}
		}

		.custom-confirm-goods-edit {
			width: 138rpx;
			height: 54rpx;
			background: rgba(255, 232, 217, 0.3);
			border-radius: 40rpx;
			font-weight: 350;
			font-size: 24rpx;
			color: #FF6200;
			line-height: 54rpx;
			text-align: center;
		}

		.custom-confirm-goods-confirm {
			width: 96rpx;
			height: 54rpx;
			background: linear-gradient(257deg, #F15D00 0%, #F9CEA6 100%, #F9CEA6 100%);
			border-radius: 40rpx;
			font-weight: 350;
			font-size: 24rpx;
			color: #FFFFFF;
			line-height: 54rpx;
			text-align: center;
		}
	}
</style>